<!DOCTYPE html>
<html lang="zn">
<head>
    <meta charset="UTF-8">
    <title>高度塌陷的最终解决方案</title>
    <style>
        .box1{
            border: 10px red solid;
            /* overflow: hidden; */
        }

        .box2{
            width: 100px;
            height: 100px;
            background-color: #bfa;
            float: left;
        }

        .box3{
            clear: both;
        }

        .box1::after{
            content: '';
            display: block;
            clear: both;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="box2"></div>
        <!-- <div class="box3"></div> -->
    </div>
</body>
</html>